package service.auth.impl;

import java.util.Map;

import model.auth.Resources;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import service.auth.ResourcesService;
import core.base.page.Page;
import core.base.page.PageRequest;
import dao.auth.ResourcesDao;

@Service("auth.ResourcesService")
public class ResourcesServiceImpl implements ResourcesService {

	@Autowired
	@Qualifier("auth.ResourcesDao")
	private ResourcesDao resourcesDao;

	public int deleteById(Long id) {
		return resourcesDao.deleteById(id);
	}

	public int deleteBatch(Long[] ids) {
		return resourcesDao.deleteBatch(ids);
	}

	public Resources getById(Long id) {
		Resources res = resourcesDao.getById(id);
		return res;
	}

	public void insert(Resources model) {
		resourcesDao.insert(model);
	}

	public Page<Resources> queryForPage(PageRequest<Map> pageReq) {
		Page<Resources> page = resourcesDao.queryForPage(pageReq);
		return page;
	}

	public void setResourcesDao(ResourcesDao resourcesDao) {
		this.resourcesDao = resourcesDao;
	}

}
